// 垂直布局

$subMenuActiveBg: #4a5666;

#app {
  height: 100%;

  .main-container-vertical {
    transition: margin-left 0.28s;
    margin-left: $sideBarWidthVertical;
    position: relative;
    background-color: antiquewhite;
  }

  .navbar {
    height: $navbarHeight;
    background-color: #fff;

    #hamburger-container {
      padding: 0px 15px;
      display: flex;
      height: 100%;
      align-items: center;
      float: left;
    }
    .sidebarLogoFade-enter-active {
      transition: opacity 1.5s;
    }

    .sidebarLogoFade-enter,
    .sidebarLogoFade-leave-to {
      opacity: 0;
    }

    .sidebar-logo-container {
      position: relative;
      width: $sideBarWidthVertical;
      height: 50px;
      line-height: 50px;
      text-align: center;
      overflow: hidden;
      display: inline;
      float: left;

      & .sidebar-logo-link {
        height: 100%;
        width: 100%;

        & .sidebar-logo {
          width: 32px;
          height: 32px;
          vertical-align: middle;
          margin-right: 6px;
          border-radius: 10px;
          text-decoration: none;
        }

        & .sidebar-title {
          display: inline-block;
          margin: 0;
          color: rgb(12, 1, 1);
          font-weight: 600;
          line-height: 50px;
          font-size: 14px;
          font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
          vertical-align: middle;
          text-align: center;
        }
      }

      &.collapse {
        .sidebar-logo {
          margin-right: 0px;
        }
      }
    }
    .sidebar-logo-container.collapse {
      width: $hideSideBarWidthVertical !important;
    }
  }

  .app-main {
    min-height: calc(100vh - $navbarHeight);
    background-color: rgb(240 242 245);
    position: relative;
    overflow: hidden;
    margin-left: $sideBarWidthVertical;
    transition: margin-left 0.28s;
  }
  .fixed-header + .app-main {
    padding-top: $tagsViewHeight + $navbarHeight;
  }
  .hasTagsView {
    .fixed-header {
      position: fixed;
      top: $navbarHeight;
      right: 0;
      z-index: 9;
      width: calc(100% - #{$sideBarWidthVertical});
      transition: width 0.28s;
      padding: 0;
    }
    .app-main {
      /* 84 = navbar + tags-view = 50 + 34 */
      min-height: calc(100vh - $tagsViewHeight - $navbarHeight);
    }
  }

  .sidebar-container-vertical {
    transition: width 0.28s;
    width: $sideBarWidthVertical !important;
    background-color: $menuBg;
    min-height: calc(100vh - #{$navbarHeight});
    position: fixed;
    font-size: 14px;
    top: $navbarHeight;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    color: whitesmoke;

    // reset element-plus css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar {
      .el-menu {
        background-color: rgb(48 65 86);
        --el-menu-bg-color: #304156;
        --el-menu-text-color: #ffffff;
        --el-menu-hover-text-color: #ffffff;
        --el-menu-active-color: #f6f8f9;

        .el-sub-menu__title:hover {
          background-color: $subMenuActiveBg;
        }
      }
      .el-menu-vertical:not(.el-menu--collapse) {
        width: $sideBarWidthVertical !important;
        min-height: 400px;
      }

      .el-menu-vertical:is(.el-menu--collapse) {
        width: $hideSideBarWidthVertical !important;
      }

      .el-menu-item {
        justify-content: flex-start;
        align-content: flex-start;
      }

      // :background-color="mode==='vertical'?'rgb(48 65 86)':'#ffffff'"
      // :active-text-color="mode==='vertical'?'#f6f8f9':''"
      // :text-color="mode==='vertical'?'#ffffff':'#121111'"
    }

    a {
      text-decoration: none;
    }
  }

  //隐藏左侧菜单时候的样式
  .hideSidebar {
    .sidebar-container-vertical {
      width: $hideSideBarWidthVertical !important;
    }

    .app-main {
      margin-left: $hideSideBarWidthVertical !important;
    }
    .main-container-vertical {
      margin-left: $hideSideBarWidthVertical !important;
      width: calc(100% - $hideSideBarWidthVertical);
    }
    .el-sub-menu {
      overflow: hidden;

      & > .el-sub-menu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .el-sub-menu__icon-arrow {
          display: none;
        }
        span {
          display: none;
        }
      }
    }
  }
}
// when menu collapsed
.el-menu--vertical {
  .nest-menu .el-submenu > .el-submenu__title,
  .el-menu-item {
    &:hover {
      // you can use $subMenuHover
      background-color: $menuHover !important;
    }
  }

  .nest-menu {
    & > a {
      text-decoration: none;
    }
    .is-active {
      background-color: $subMenuActiveBg;
    }
  }

  .el-menu {
    --el-menu-bg-color: #304156;
    --el-menu-text-color: #ffffff;
    --el-menu-hover-text-color: #ffffff;
    --el-menu-active-color: #f6f8f9;
  }

  // the scroll bar appears when the subMenu is too long
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }
  }
}
